Add synchronous load_with constructors and run escape hatch to wrapped_async#864
Add synchronous load_with constructors and run escape hatch to wrapped_async#864suri-kumkaran wants to merge 4 commits intomainfrom
load_with constructors and run escape hatch to wrapped_async#864Conversation
There was a problem hiding this comment.
Pull request overview
Adds synchronous entry points to load prebuilt async DiskANN indexes in diskann-providers, and introduces a run escape hatch for calling async-only inner methods from the sync wrapper.
Changes:
- Added
load_with_multi_thread_runtime,load_with_current_thread_runtime, andload_with_handlesync constructors that wrapLoadWith::load_with. - Added
runto execute an arbitrary async closure on the wrapper’s runtime/handle. - Added an end-to-end save→sync-load→search round-trip test and refactored runtime creation into helpers.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (72.65%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #864 +/- ##
==========================================
- Coverage 90.45% 89.27% -1.18%
==========================================
Files 442 442
Lines 83248 83368 +120
==========================================
- Hits 75301 74430 -871
- Misses 7947 8938 +991
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Why
Sync callers who need to load a prebuilt index must manually create a tokio runtime and call the async
LoadWithtrait — leaking async internals. Similarly, there's no way to call an async method on the inner index if a sync wrapper doesn't exist for it yet.What
All changes are in
diskann-providers/src/index/wrapped_async.rs.load_with_multi_thread_runtime,load_with_current_thread_runtime,load_with_handle— Sync constructors that load a prebuilt index from storage, mirroring the existingnew_with_*pattern.run— Escape hatch: runs any async closure against the inner index on the wrapper's runtime, for methods that don't have a dedicated sync wrapper.create_multi_thread_runtime/create_current_thread_runtimehelpers to reduce duplication.test_save_then_sync_load_round_trip— End-to-end test: build → insert → save (viarun) → load → search.